package stripesbook.action;

import org.stripesbook.rayures.view.ViewObject;
import org.stripesbook.rayures.view.stripes.SForm;
import org.stripesbook.rayures.view.stripes.SHidden;
import org.stripesbook.rayures.view.stripes.SLink;
import org.stripesbook.rayures.view.stripes.SPassword;
import org.stripesbook.rayures.view.stripes.SSubmit;
import org.stripesbook.rayures.view.stripes.SText;

public class LoginView extends ViewObject<LoginView> {
  public SForm getForm() {
    return tag(SForm.class)
      .legend(bundle.get("login.title"))
      .addInputs(
        tag(SText.class).name("username"),
        tag(SPassword.class).name("password"))
      .add(tag(SHidden.class).name("loginUrl"))
      .addButton(tag(SSubmit.class).name("login"));
  }
  public SLink getRegisterLink() {
    return tag(SLink.class).beanclass(RegisterActionBean.class)
      .label(bundle.get("register"));
  }
  public SLink getLoadMockUserLink() {
    return tag(SLink.class).beanclass(MockDataLoaderActionBean.class)
      .label(bundle.get("loadMockUser"));
  }
}
